/* webpack.config_dev.js */
var path = require('path');
var webpack = require("webpack");
var webpackMerge = require('webpack-merge');
var webpackConfig = require('./webpack.config.js');
var env_var = require('./environment_variable.js');

module.exports = webpackMerge(webpackConfig, {
    mode: 'development',
    devServer: {
        port: 8080,
        host: '0.0.0.0',
        proxy: {
            '/apis': {
                target: env_var.development.serverURL, // 接口的域名和端口 如果端口为80则可以不写
                // target: 'http://182.92.169.87:80/apis', // 接口的域名和端口 如果端口为80则可以不写
                // target: 'http://54.151.163.189:80/apis', // 接口的域名和端口 如果端口为80则可以不写
                pathRewrite: {'^/apis' : ''}, // 如果不是以api开头的可以清空
                changeOrigin: true
            }
        }
    },
    plugins: [
        new webpack.DefinePlugin({
            'process.env': {
                NODE_ENV: JSON.stringify('development')
            }
        })
    ]
});